package com.kungfuhacking.wristbandpro.mqtt.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.kungfuhacking.wristbandpro.base.bean.Basebean;

import java.util.List;

/**
 * Created by Aaron on 16/3/21.
 */
public class MqttServiceBean extends Basebean implements Parcelable {

    private String ip;
    private String port;
    private int isPush;
    private List<TopicBean> topicList;

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public List<TopicBean> getTopicList() {
        return topicList;
    }

    public void setTopicList(List<TopicBean> topicList) {
        this.topicList = topicList;
    }

    public int getIsPush() {
        return isPush;
    }

    public void setIsPush(int isPush) {
        this.isPush = isPush;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.ip);
        dest.writeString(this.port);
        dest.writeInt(this.isPush);
        dest.writeTypedList(this.topicList);
    }

    public MqttServiceBean() {
    }

    protected MqttServiceBean(Parcel in) {
        this.ip = in.readString();
        this.port = in.readString();
        this.isPush = in.readInt();
        this.topicList = in.createTypedArrayList(TopicBean.CREATOR);
    }

    public static final Parcelable.Creator<MqttServiceBean> CREATOR = new Parcelable.Creator<MqttServiceBean>() {
        @Override
        public MqttServiceBean createFromParcel(Parcel source) {
            return new MqttServiceBean(source);
        }

        @Override
        public MqttServiceBean[] newArray(int size) {
            return new MqttServiceBean[size];
        }
    };
}
